package src;

import javax.swing.*;
import java.awt.*;

public class MainFrame extends JFrame {
    public MainFrame() {
        setTitle("银行管理系统");
        setSize(400, 300);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setLocationRelativeTo(null);

        // 创建主面板
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new GridLayout(2, 1, 10, 10));
        mainPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

        // 创建管理员按钮
        JButton adminButton = new JButton("管理员登录");
        adminButton.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        adminButton.addActionListener(e -> {
            new AdminLoginFrame().setVisible(true);
            this.dispose();
        });

        // 创建客户按钮
        JButton customerButton = new JButton("客户登录");
        customerButton.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        customerButton.addActionListener(e -> {
            new CustomerLoginFrame().setVisible(true);
            this.dispose();
        });

        mainPanel.add(adminButton);
        mainPanel.add(customerButton);

        add(mainPanel);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            new MainFrame().setVisible(true);
        });
    }
} 